import { defineStore } from 'pinia'
import { ref } from 'vue'

const useUserStore = defineStore(
  'user',
  () => {
    const count = ref(0)

    const increment = () => {
      count.value++
    }

    return {
      count,
      increment
    }
  },
  {
    persist: true // 开启状态持久化
  }
)

export default useUserStore
